#ifndef __USER_INTERFACE_H_
#define __USER_INTERFACE_H_

#ifdef __cplusplus
extern "C"{
#endif

#include "mc_interface.h"

s16 MciGetIa(pMCI_t pMCI_Handle);
s16 MciGetIb(pMCI_t pMCI_Handle);
s16 MciGetIc(pMCI_t pMCI_Handle);
s16 MciGetId(pMCI_t pMCI_Handle);
s16 MciGetIq(pMCI_t pMCI_Handle);
s16 MciGetIalpha(pMCI_t pMCI_Handle);
s16 MciGetIbeta(pMCI_t pMCI_Handle);
s16 MciGetIbus(pMCI_t pMCI_Handle);
s16 MciGetVbus(pMCI_t pMCI_Handle);
void MciSetVelocityReference(pMCI_t pMCI_Handle, s16 Veloref);
void MciSetIdReference(pMCI_t pMCI_Handle, s16 Idref);
void MciSetIqReference(pMCI_t pMCI_Handle, s16 Iqref);
s16 MciGetCalibrationOffset(pMCI_t pMCI_Handle, u8 CalibNum);
void MciSetCalibrationTimesPower(pMCI_t pMCI_Handle, u16 TimesPow);
void MciSetCalibrationOffsetMax(pMCI_t pMCI_Handle, s16 OffsetMax);
void MciSetChargeTime(pMCI_t pMCI_Handle, u16 ChargeTime);
#if defined(ROTOR_INITIAL_POSITION_DETECT)
s16 MciGetPositionSeekTheta(pMCI_t pMCI_Handle);
void MciSetRipdPulseWidth(pMCI_t pMCI_Handle, u16 PulseWidth);
void MciSetRipdRecoverWidth(pMCI_t pMCI_Handle, u16 RecoverWidth);
void MciSetRipdSwitchWidth(pMCI_t pMCI_Handle, u16 SwitchWidth);
#endif
void MciSetAlignTime(pMCI_t pMCI_Handle, u16 AlignTime);
void MciSetAlignAngle(pMCI_t pMCI_Handle, s16 AlignAngle);
void MciSetAlignCurrent(pMCI_t pMCI_Handle, s16 AlignCurrent);
void MciSetAlignVoltage(pMCI_t pMCI_Handle, s16 AlignCurrent);
void MciSetTargetDrive(pMCI_t pMCI_Handle, s16* TargetDrive);
void MciSetTargetVelocity(pMCI_t pMCI_Handle, s16* TargetVelo);
void MciSetDriveIncrement(pMCI_t pMCI_Handle, s16* DriveIncr);
void MciSetVelocityIncrement(pMCI_t pMCI_Handle, s16* VeloIncr);
s16 MciGetStartupCurrentDrive(pMCI_t pMCI_Handle);
s16 MciGetStartupCurrentVelocity(pMCI_t pMCI_Handle);
void MciSetSwitchMax(pMCI_t pMCI_Handle, s16 SwitchMax);
void MciSetSwitchMin(pMCI_t pMCI_Handle, s16 SwitchMin);
void MciSetSwitchContinousCorrectNumber(pMCI_t pMCI_Handle, u16 Correct);
void MciSetSwitchTime(pMCI_t pMCI_Handle, u16 SwitchTime);
u8 MciGetOntheflyStage(pMCI_t pMCI_Handle);
void MciSetOntheflyVirtualSensorStartMinimumVelocity(pMCI_t pMCI_Handle, s16 VSStartMin);
void MciSetOntheflyVirtualSensorStartMaximumVelocity(pMCI_t pMCI_Handle, s16 VSStartMax);
void MciSetOntheflyVirtualSensorSwitchMinimumVelocity(pMCI_t pMCI_Handle, s16 VSSwitchMin);
void MciSetOntheflyVirtualSensorSwitchMaximumVelocity(pMCI_t pMCI_Handle, s16 VSSwitchMax);
s16 MciGetVelocity(pMCI_t pMCI_Handle);
s16 MciGetTheta(pMCI_t pMCI_Handle);
void MciSetVelocityPIController(pMCI_t pMCI_Handle, PI_t PIController);
void MciSetTorquePIController(pMCI_t pMCI_Handle, PI_t PIController);
void MciSetFluxPIController(pMCI_t pMCI_Handle, PI_t PIController);
bool MciGetCalibStatus(pMCI_t pMCI_Handle);
bool MciGetHallStudyStatus(pMCI_t pMCI_Handle);
bool MciGetChargeStatus(pMCI_t pMCI_Handle);
bool MciGetPosSeekStatus(pMCI_t pMCI_Handle);
bool MciGetAlignStatus(pMCI_t pMCI_Handle);
bool MciGetOntheflyStatus(pMCI_t pMCI_Handle);
bool MciGetStartupStatus(pMCI_t pMCI_Handle);
bool MciGetSwitchoverStatus(pMCI_t pMCI_Handle);
bool MciGetStopStatus(pMCI_t pMCI_Handle);
bool MciGetFaultStatus(pMCI_t pMCI_Handle);
void MciCommandStart(pMCI_t pMCI_Handle);
void MciCommandCalib(pMCI_t pMCI_Handle);
void MciCommandHallStudy(pMCI_t pMCI_Handle);
void MciCommandAlign(pMCI_t pMCI_Handle);
void MciCommandStop(pMCI_t pMCI_Handle);
void MciCommandAcknowledgeFault(pMCI_t pMCI_Handle);
void MciCommandCurrentLoop(pMCI_t pMCI_Handle);
void MciCommandVelocityLoop(pMCI_t pMCI_Handle);
u16 MciGetFault(pMCI_t pMCI_Handle);
void MciSetHighFrequencyInjectionVoltage(pMCI_t pMCI_Handle, s16 hInjectVolt);
void MciSetHighFrequencyInjectionPhaseLockLoop(pMCI_t pMCI_Handle, PI_t Pll);


#ifdef __cplusplus
}
#endif

#endif
